﻿using System;

namespace enyo
{
    /// <summary>
    /// A control that displays a scrolling list of rows.
    /// It is suitable for displaying very large lists.
    /// VirtualList is optimized such that only a small portion of the list is rendered at a given time.
    /// A flyweight strategy is employed to render one set of list row controls as needed for as many rows as are contained in the list.
    /// Note: Because a VirtualList contains a Scroller, it must have a fixed size. If a list with variable height is required, use an enyo.VirtualRepeater.
    /// </summary>
    public class VirtualList : ScrollingList
    {
        public int LookAhead { get; set; }
        public int PageSize { get; set; }

        /// <summary>
        /// function(sender, page)
        /// </summary>
        public EnyoEvent<Control, int> onAcquirePage;
        

        /// <summary>
        /// function(sender, page)
        /// </summary>
        public EnyoEvent<Control, int> onDiscardPage;

        /// <summary>
        /// Returns the selection component that manages the selection state for this list.
        /// </summary>
        /// <returns></returns>
        public Selection GetSelection()
        {
            return null;
        }

        /// <summary>
        /// Get the selection state for the given row index.
        /// </summary>
        /// <param name="rowIndex"></param>
        /// <returns></returns>
        public bool IsSelected(int rowIndex)
        {
            return false;
        }

        /// <summary>
        /// Set the selection state for the given row index.
        /// </summary>
        /// <param name="rowIndex"></param>
        /// <param name="data"></param>
        public void Select(int rowIndex, object data)
        {
        }

        /// <summary>
        /// Enable/disable multi-select mode
        /// </summary>
        /// <param name="multi"></param>
        public void SetMultiSelect(bool multi)
        {
        }
    }
}
